#include "../../include/timer_interface.hpp"
#include "timermanager.h"

LIBVERSION __timer_libversion = timer_libversion;

static bool CheckVersion(LIBVERSION libversion)
{
	if (__timer_libversion == libversion)
	{
		return true;
	}

	return false;
}

ITimerManager* CreateTimerManager( ITimerResponse* pTimerResponse, bool bExact, LIBVERSION libversion )
{
	if (!CheckVersion(libversion))
	{
		return NULL;
	}

	CTimerManager* poTimerManager = new CTimerManager;
	if (NULL != poTimerManager)
	{
		if (!poTimerManager->Init(pTimerResponse, bExact))
		{
			poTimerManager->UnInit();
			delete poTimerManager;
			poTimerManager = NULL;
		}
	}

	return poTimerManager;
}
